import { WsClient } from "tsrpc-browser";
import { serviceProto, ServiceType } from "./shared/protocols/serviceProto";

export function getClient(): WsClient<ServiceType> {
    return new WsClient(serviceProto, {
        server: "ws://81.68.188.102:3000",
        // Remove this to use binary mode (remove from the server too)
        heartbeat: {
            // 两次心跳检测的间隔时间（毫秒）
            interval: 8000,
            // 发出心跳检测包后，多长时间未收到回复视为超时（毫秒），超时将使连接断开
            timeout: 5000
        },
        json: true,
        // logger: console,
    })
}